<?php $this->load->view('header', $head);?>
<div data-role="page" id="page-register">
	<div data-role="header">
		<h1>회원가입</h1>
		<a data-role="button" data-rel="back" data-icon="back">Back</a>
	</div><!-- /header -->
	<div data-role="content">
		<?=form_open('ajax/register', array('class'=>'ajax-form'))?>
			<ul data-role="listview" <?=$this->agent->is_mobile()?'':'data-inset="true"'?> data-theme="c">
				<li data-role="fieldcontain">
					<label for="username">사용자명:</label>
					<input type="text" name="username" id="username" value="<?=set_value('username')?>"  />
					<?=form_error('username')?>
				</li>
				<li data-role="fieldcontain">
					<label for="password">비밀번호:</label>
					<input type="password" name="password" id="password" value=""  />
					<?=form_error('password')?>
				</li>
				<li data-role="fieldcontain">
					<label for="password_confirm">비밀번호 확인:</label>
					<input type="password" name="password_confirm" id="password_confirm" value=""  />
					<?=form_error('password_confirm')?>
				</li>
				<li data-role="fieldcontain">
					<label for="name">이름:</label>
					<input type="text" name="name" id="name" value="<?=set_value('name')?>"  />
					<?=form_error('name')?>
				</li>
				<li data-role="fieldcontain">
					<fieldset data-role="controlgroup" class="ui-group-narrow" data-type="horizontal">
						<legend>생년월일:</legend>
					
						<label for="birthday-year">연</label>
						<select name="birthday[]" id="birthday-year">
						<option value="">년</option>
						<?php for($i = date('Y'); $i > date('Y')-100; $i--): ?>
							<option value="<?=$i?>"><?=$i?></option>
						<?php endfor; ?>
						</select>
						<label for="birthday-month">월</label>
						<select name="birthday[]" id="birthday-month">
							<option value="">월</option>
						<?php for($i = 1; $i <= 12; $i++): ?>
							<option value="<?=$i?>"><?=$i?></option>
						<?php endfor; ?>
						</select>
						<label for="birthday-day">일</label>
						<select name="birthday[]" id="birthday-day">
							<option value="">일</option>
						<?php for($i = 1; $i <= 31; $i++): ?>
							<option value="<?=$i?>"><?=$i?></option>
						<?php endfor; ?>
						</select>
					</fieldset>
					<?=form_hidden('birthday', set_value('birthday'))?>
					<?=form_error('birthday')?>
				</li>
				<li data-role="fieldcontain">
					<fieldset data-role="controlgroup" data-type="horizontal">
						<legend>
							성별:
						</legend>
						<input type="radio" value="male" name="gender" id="radio-gender-male" <?=set_radio('gender', 'male', TRUE)?>)/>
						<label for="radio-gender-male"> 남 </label>
						<input type="radio" value="female" name="gender" id="radio-gender-female" <?=set_radio('gender', 'female')?>/>
						<label for="radio-gender-female"> 여 </label>
					</fieldset>
					<?=form_error('gender')?>
				</li>
				<li data-role="fieldcontain">
					<fieldset data-role="controlgroup">
						<legend>최종학력:</legend>
						<?=form_education_selector()?>
					</fieldset>
					<?=form_error('education')?>
				</li>
				<li data-role="fieldcontain">
					<label for="phone">전화번호:</label>
					<input type="tel" name="phone" id="phone" value="<?=set_value('phone')?>"/>
					<?=form_error('phone')?>
				</li>
				<li data-role="fieldcontain">
					<label for="email">이메일 주소:</label>
					<input type="email" name="email" id="email" value="<?=set_value('email')?>"/>
					<?=form_error('email')?>
				</li>
				<li data-role="fieldcontain">
					<fieldset data-role="controlgroup" class="address-selector">
						<legend>주소:</legend>
						<label for="address1">도/시</label>
						<?=form_dropdown('address1_id', $address[0], set_value('address1_id'), 'id="address1"')?>
						<label for="address2">시/군/구</label>
						<?=form_dropdown('address2_id', $address[1], set_value('address2_id'), 'id="address2"')?>	
						<label for="address3">동/읍/면</label>
						<?=form_dropdown('address3_id', $address[2], set_value('address3_id'), 'id="address3"')?>
					</fieldset>
				</li>
				<li data-role="fieldcontain">
					<label for="address_detail">상세주소:</label>
					<input type="text" name="address_detail" id="address_detail" value="<?=set_value('address_detail')?>"/>
					<?=form_error('address_detail')?>
				</li>
				<li data-role="fieldcontain">
					<label for="category">관심 카테고리</label>
					<?=category_selector(set_value('category'))?>
					<?=form_error('category')?>
				</li>
				<li data-role="fieldcontain">
					<label for="keyword">관심 키워드</label>
					<input type="text" name="keyword" id="keyword" value="<?=set_value('keyword')?>"/>
					<?=form_error('keyword')?>
				</li>
				<li data-role="list-divider"></li>
				<li class="ui-body">
					<fieldset class="ui-grid-a">
						<div class="ui-block-a">
							<a href="<?=site_url('user/login')?>" data-role="button">
								로그인
							</a>
						</div>
						<div class="ui-block-b">
							<button type="submit" data-theme="b">
								가입하기
							</button>
						</div>
					</fieldset>
				</li>
			</ul>
		<?=form_close()?>
	</div><!-- /content -->
</div>
<?php $this->load->view('footer');?> 